:host {
  --p-width: 100%;
  --margin-top: 1rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
}

.ea-skeleton-item_wrap {
  position: relative;
  background-color: #f2f2f2;
  border-radius: 4px;

  &.animated {
    background-image: linear-gradient(
      90deg,
      #f6f6f6 25%,
      #e8e8e8 37%,
      #f6f6f6 63%
    );

    background-size: 400% 100%;

    animation: skeleton-loading 1.4s ease infinite;
  }
}

.ea-skeleton-item_wrap {
  &.ea-skeleton_p,
  &.ea-skeleton_image,
  &.ea-skeleton_text,
  &.ea-skeleton_h1,
  &.ea-skeleton_h2,
  &.ea-skeleton_h3,
  &.ea-skeleton_h4,
  &.ea-skeleton_h5,
  &.ea-skeleton_h6 {
    width: 100%;
  }

  &.ea-skeleton_p {
    width: var(--p-width);
    height: 16px;

    margin-top: var(--margin-top);
  }

  &.ea-skeleton_image {
    width: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;

    height: 100%;

    .skeleton-image {
      width: 30%;
      height: 30%;
    }
  }

  &.ea-skeleton_text {
    height: 13px;

    margin: 2px 0;
  }

  &.ea-skeleton_h1 {
    height: 2rem;

    margin-block: 0.67rem;
  }

  &.ea-skeleton_h2 {
    height: 1.5rem;

    margin-block: 0.83rem;
  }

  &.ea-skeleton_h3 {
    height: 1.17rem;

    margin-block: 1rem;
  }

  &.ea-skeleton_h4 {
    height: 1rem;

    margin-block: 1.33rem;
  }

  &.ea-skeleton_h5 {
    height: 0.83rem;

    margin-block: 1.67rem;
  }

  &.ea-skeleton_h6 {
    height: 0.67rem;

    margin-block: 2.33rem;
  }
}
